Skip to content

fix(webrtc): reduce PeerConnectionAnalyzer log verbosity during bad quality#18418

Open
pallavibakale wants to merge 3 commits into
nextcloud:mainfrom
pallavibakale:fix/reduce-verbose-logs
Open

fix(webrtc): reduce PeerConnectionAnalyzer log verbosity during bad quality#18418
pallavibakale wants to merge 3 commits into
nextcloud:mainfrom
pallavibakale:fix/reduce-verbose-logs

Conversation

@pallavibakale

@pallavibakale pallavibakale commented Jun 23, 2026

Copy link
Copy Markdown

☑️ Resolves

🛠️ API Checklist

🚧 Tasks

When connection quality is bad, _logStats was called every second and logged the full 5-7 entry rtcStats history each time, causing heavy duplication in the logs.

Now only the new rtcStats entries (added since the last log) are printed on each subsequent bad check. When quality recovers, any remaining unlogged entries are flushed once so no data is missing.

🏁 Checklist

  • ⛑️ Tests (unit and/or integration) are included or not possible
  • 📘 API documentation in docs/ has been updated or is not required
  • 🔖 Capability is added or not needed

…uality

Signed-off-by: pallavibakale <pallavibakale09@gmail.com>
@nickvergessen nickvergessen requested a review from danxuliu June 24, 2026 04:15
@nickvergessen nickvergessen added this to the ⛅ Next Major (35) milestone Jun 24, 2026
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

danxuliu added 2 commits July 8, 2026 10:44
This is a preparation to test passing different parameters.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>

@danxuliu danxuliu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay and thanks for your contribution!

I left some review comments and took the freedom to add some unit tests to verify the new parameters of _logRtcStats.

Independently of all that I noticed that, sometimes, all the RTC stats are logged even if the connection did not improve since the last log. However, I am not sure if the problem is in how the RTC stats are logged or if there is a problem in the quality calculation (like a good quality being suddenly reported between two very bad reports) 🤔

this._timestampsForLogs[kind].reset()

this._totalRtcStatsAdded[kind] = 0
this._loggedUpToRtcStatsTotal[kind] = -1

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be necessary (but I am not fully sure 🤔). Although the data to calculate the quality is reset, the RTC stats array is never reset, so the total count of RTC stats and the last logged RTC stat would still be valid and independent of the data to calculate the quality.

console.debug('%s: Timestamps: %s', tag, this._timestampsForLogs[kind].toString())

this._logRtcStats(tag, kind)
const startTotal = logAll ? 0 : this._loggedUpToRtcStatsTotal[kind]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the full RTC stats are logged they will always be indexed at 0. However, subsequent logs will take into account the total count of RTC stats, so the value will jump to something higher. Therefore the initial log should also respect the total count of RTC stats (probably something like logAll ? this._totalRtcStatsAdded[kind] - newcount : this._loggedUpToRtcStatsTotal[kind], although I have not checked it).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reduce verbosity of PeerConnectionAnalyzer logs

3 participants